
package dieci.system;

import dieci.database.PersistentObject;
import dieci.utils.Redondeo;

/**
 *
 * @author DuckSys
 */
public class OrderDetails implements PersistentObject{

    private long orderId;
    private long productId;
    private int amount;
    private double cost;


    public OrderDetails()
    {
    }

    public OrderDetails(long productId, int amount, double cost)
    {
        this.productId = productId;
        this.amount = amount;
        this.cost = Redondeo.Redondear(cost, 2);
    }

    public OrderDetails(long orderId, long productId, int amount, double cost)
    {
        this(productId,amount,cost);
        this.orderId = orderId;        
    }



    


        /**
     * Get the value of cost
     *
     * @return the value of cost
     */
    public double getCost()
    {
        return cost;
    }

    /**
     * Set the value of cost
     *
     * @param cost new value of cost
     */
    public void setCost(double cost)
    {
        this.cost = Redondeo.Redondear(cost, 2);
    }
    
    /**
     * Get the value of amount
     *
     * @return the value of amount
     */
    public int getAmount()
    {
        return amount;
    }

    /**
     * Set the value of amount
     *
     * @param amount new value of amount
     */
    public void setAmount(int amount)
    {
        this.amount = amount;
    }

    
    /**
     * Get the value of productId
     *
     * @return the value of productId
     */
    public long getProductId()
    {
        return productId;
    }

    /**
     * Set the value of productId
     *
     * @param productId new value of productId
     */
    public void setProductId(long productId)
    {
        this.productId = productId;
    }

    
    /**
     * Get the value of orderId
     *
     * @return the value of orderId
     */
    public long getOrderId()
    {
        return orderId;
    }

    /**
     * Set the value of orderId
     *
     * @param orderId new value of orderId
     */
    public void setOrderId(long orderId)
    {
        this.orderId = orderId;
    }

}
